from ui.MainWin import MainWin
from ui.record_ui import RecordUi
from ui.table_ui import TableUi


class UiController:

    def __init__(self, app):
        self.app = app
        pass

    def show_main(self):
        self.win1 = MainWin(self.app)
        self.win1.switch_win.connect(self.show_table)
        self.win1.show()

    def show_table(self, pro):
        print(pro)
        self.win2 = TableUi(self.app, pro)
        self.win2.switch_win.connect(self.show_main)
        self.win2.detail_switch_win.connect(self.show_record)
        self.win2.show()

    def show_record(self, pro):
        print("!")
        print(pro)
        self.win3 = RecordUi(self.app, pro)
        self.win3.switch_win.connect(self.show_table)
        self.win3.show()

    def show_win3(self):
        pass
